﻿/*************************************************************************
File:   as/streamCam2.as
Author: Duykham
UpDate: 01/11/2006
TODO:   
/*************************************************************************/
echo ("#included: streamCam2.as");

///////////////////////////////////////////////////////////////////////////
//TODO: included files

///////////////////////////////////////////////////////////////////////////
//TODO: khai bao bien
 //Tao mot ket noitoi FMS//
myConnection = new NetConnection ();
myConnection.connect (_root.CFG.fmsApp);
in_ns = new NetStream (myConnection);
var name_Stream = name_txt;
var label_txt;
///////////////////////////////////////////////////////////////////////////
//TODO: functions
//enlarge video button
large_btn.onRelease = function()
{
	trace ("name_txt: "+name_txt);
	_global.nameStream = name_Stream;
	_level0.gotoAndStop("strm2");
	_global.unLoadMovies();
};

//Play Pause button
play_btn.onRelease = function ()
{
	if (label_txt.text == "Play")
	{
		label_txt.text = "Pause";
		videomask_mc._visible = false;
		large_btn.enabled = true;
	}
	else
	{
		label_txt.text = "Play";
		videomask_mc._visible = true;
		large_btn.enabled = false;
	}
	in_ns.pause ();
};
/*
function unLoadMovies ()
{
	_level0.cam0_mc.unloadMovie();
	_level0.cam1_mc.unloadMovie();
	_level0.cam2_mc.unloadMovie();
	_level0.cam3_mc.unloadMovie();
	_level0.cam4_mc.unloadMovie();
	_level0.cam5_mc.unloadMovie();
}
*/
//onLoad
in_ns.play (name_Stream);
cam_vid.attachVideo(in_ns);
videomask_mc._visible = false;
label_txt.text = "Pause";